﻿@{ 
    Layout = null;
    Response.Clear();
    Response.ContentType = "application/xrds+xml";
    //Response.OutputCache(86400);
    

    var opIdentifier = (bool?)(ViewData["OPIdentifier"] ?? default(bool?));
}<?xml version="1.0" encoding="UTF-8"?>
<xrds:XRDS
	xmlns:xrds="xri://$xrds"
	xmlns:openid="http://openid.net/xmlns/1.0"
	xmlns="xri://$xrd*($v*2.0)">
	<XRD>
		<Service priority="10">
@if (opIdentifier != null) {
			<Type>http://specs.openid.net/auth/2.0/server</Type>
} else {
			<Type>http://specs.openid.net/auth/2.0/signon</Type>
}
			<Type>http://openid.net/extensions/sreg/1.1</Type>
			<Type>http://axschema.org/contact/email</Type>
			
			@*Add these types when and if the Provider supports the respective aspects of the UI extension.
			<Type>http://specs.openid.net/extensions/ui/1.0/mode/popup</Type>
			<Type>http://specs.openid.net/extensions/ui/1.0/lang-pref</Type>
			<Type>http://specs.openid.net/extensions/ui/1.0/icon</Type>*@
			<URI>@(new Uri(Request.Url, Response.ApplyAppPathModifier("~/OpenId/Provider")))</URI>
		</Service>
@if (opIdentifier == null) {
		<Service priority="20">
			<Type>http://openid.net/signon/1.0</Type>
			<Type>http://openid.net/extensions/sreg/1.1</Type>
			<Type>http://axschema.org/contact/email</Type>
			<URI>@(new Uri(Request.Url, Response.ApplyAppPathModifier("~/OpenId/Provider")))</URI>
		</Service>
 } 
	</XRD>
</xrds:XRDS>